package com.ld.campus_help.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ld.campus_help.entity.User;
import com.ld.campus_help.mapper.UserMapper;
import com.ld.campus_help.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public User login(Integer studentId, String password, Integer schoolId) {
        QueryWrapper<User> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("student_id", studentId);
        queryWrapper.eq("password", password);
        queryWrapper.eq("school_id", schoolId);
        return userMapper.selectOne(queryWrapper);
    }

    @Override
    public User Register(String username, Integer studentId, String phone, String password, Integer schoolId, String invitedCode) {
        return null;
    }
}
